<template>
	<view>
		<view class="fui-wrap" style="position: fixed;top: 0;right: 0;bottom: 0;left: 0;z-index: 9999;"
			v-if="isShowTailor">
			<!-- 	<fui-image-cropper  :src="TailorSrc" ref="tailor"></fui-image-cropper>
			
			<view class="fui-cropper__tabbar">
				<text class="fui-text" @tap.stop="isShowTailor = false">取消</text>
				<view class="fui-flex__center fui-flex__1" @tap.stop="onRotateTailor">
					<fui-icon name="rotate" color="#fff" size="52"></fui-icon>
				</view>
				<text class="fui-text" @tap.stop="onSubmitTailor">确定</text>
			</view> -->
			<jp-cropper-watermark mode="free" :width="width" :height="height" :maxWidth="1024" :maxHeight="1024"
				:url="TailorSrc" @cancel="isShowTailor = false" @ok="onSubmitTailor"></jp-cropper-watermark>
		</view>

		<fui-form ref="form">
			<fui-form-item label="主页背景图" labelSize="26">
				<view style="width:210rpx;float:right">
					<fui-upload :url="imageUpfileUrl" :fileList="bgPics" ref="bgPicUpload" sizeType="compressed" max="1"
						width="210" height="140" @success="bgPicUpSuccess" @error="bgPicUpError"
						@complete="bgPicUpComplete" Right></fui-upload>
				</view>
				<!-- <view @click="selectFile('bgpic')" style="width:600rpx; height:400rpx;">
					<image :src="bgpic" style="width:100%; height:100%; background-color: #CCC;"></image>
				</view> -->
			</fui-form-item>
			<fui-form-item label="头像" labelSize="26">
				<view style="width:100rpx;float:right">
					<fui-upload :url="imageUpfileUrl" ref="HeadPicUpload" :fileList="headList" sizeType="compressed"
						max="1" width="100" height="100" @success="HeadPicUpSuccess" @error="error"
						@complete="HeadPicUpComplete" Right></fui-upload>
				</view>
				<!-- <uni-file-picker
					limit="1" 
					:del-icon="false"  
					disable-preview 
					file-mediatype="image" 
					v-model="formData.headPic" 
					@fail="error" 
					@select="uploadPic" 
					style="width: 200rpx; height: 200rpx; background-color:#CCC;border-radius:200rpx;"
				>+</uni-file-picker> -->
			</fui-form-item>
			<fui-form-item label="昵称" labelSize="26">
				<fui-input :borderBottom="false" :padding="[0]" placeholder="请输入您的昵称" textAlign="right" textRight
					v-model="formData.nickName"></fui-input>
			</fui-form-item>
			<fui-form-item label="身份" labelSize="26" arrow highlight>
				<view style="text-align: right;" @click="setUserRole">
					<text v-for="(item,index) in userRoles" :key="index">
						{{ item.LabelName }}
						<text v-if="index < userRoles.length-1"> / </text>
					</text>
				</view>
			</fui-form-item>
			<fui-form-item label="性别" labelSize="26">
				<view style="float:right" @click="showSex">{{formData.sex['text']}}</view>
			</fui-form-item>
			<fui-form-item label="生日" labelSize="26">
				<view @click="showBirthday" style="float:right">{{formData.birthday}}</view>
			</fui-form-item>
			<fui-form-item label="地区" labelSize="26">
				<view @click="showCity" style="float:right">{{formData.city}}</view>
			</fui-form-item>
			<view class="artisterPhoto artisterBox" style="height:400rpx;">
				<view class="flexbc">
					<span class="artisterInfoTitle">形象照片</span>
					<span class="editBtn" @click="goNavPage('/myPages/pages/editPhoto?mokaInfoNav=1')">编辑</span>
				</view>
				<view class="artPics" v-if="UserPhotos.length !== 0" @click="showPhoto(UserPhotos)">
					<!-- <view class="artPicCount" v-if="UserPhotos.length > 3">{{ UserPhotos.length }}</view> -->
					<view class="artPicCount" v-if="UserPhotos.length > 3">
						<uni-icons type="image" size="14" color="#fff"></uni-icons>
						<text style="margin-left: 5rpx;">{{UserPhotos.length }}</text>
					</view>
					<view class="artPic" v-for="(item,index) in UserPhotos" :key="index" v-if="index < 3">
						<image :src="item" mode="aspectFill"></image>

						<zero-lazy-load borderRadius="10" height="300" :image="item"
							imgMode='aspectFill'></zero-lazy-load>
					</view>
				</view>
			</view>
			<view>
				<view style="padding:20rpx">形象信息</view>
				<fui-form ref="form">
					<fui-form-item label="身高" highlight arrow arrowColor="#CCC" @click="showShengao">
						<view style="float:right">{{UserBaseinfo.shengao}}cm</view>
					</fui-form-item>
					<fui-form-item label="体重" highlight arrow arrowColor="#CCC" @click="showTizhong">
						<view style="float:right">{{ UserBaseinfo.tizhong }}kg</view>
					</fui-form-item>
					<fui-form-item label="三围" highlight arrow arrowColor="#CCC" @click="showSanwei">
						<view style="float:right">
							胸围{{ UserBaseinfo.sanwei[0] }}腰围{{ UserBaseinfo.sanwei[1] }}臀围{{ UserBaseinfo.sanwei[2]}}
						</view>
					</fui-form-item>
					<fui-form-item label="罩杯" highlight arrow arrowColor="#CCC" @click="showZhaobei"
						v-if="userInfo.UserSex && JSON.parse(userInfo.UserSex).value == 0">
						<view style="float:right">{{ UserBaseinfo.zhaobei }}</view>
					</fui-form-item>
					<fui-form-item label="鞋码" highlight arrow arrowColor="#CCC" @click="showJiaoma">
						<view style="float:right">{{ UserBaseinfo.jiaoma  }}</view>
					</fui-form-item>
				</fui-form>
			</view>
			<view class="artisterPhoto artisterBox" style="height:auto;">
				<view class="flexbc">
					<span class="artisterInfoTitle">身份标签</span>
					<span class="editBtn" @click="goNavPage('/myPages/pages/roleLabelSet')">编辑</span>
				</view>
				<view style="padding-top:20rpx;">
					<view class="label" v-for="(item,index) in SetRoleLabels" :key="index">
						{{ item.text }}
					</view>
				</view>
				<view style="clear:both"></view>
			</view>
			<view class="artisterPhoto artisterBox" style="height:auto;">
				<view class="flexbc">
					<span class="artisterInfoTitle">形象风格</span>
					<span class="editBtn" @click="goNavPage('/myPages/pages/xingxiangLabelSet')">编辑</span>
				</view>
				<view style="padding-top:20rpx;">
					<view class="label" v-for="(item,index) in xingxiangLabels" :key="index">
						{{ item.text }}
					</view>
				</view>
				<view style="clear:both"></view>
			</view>
			<view class="artisterPhoto artisterBox" style="height:auto;">
				<view class="flexbc">
					<span class="artisterInfoTitle">接单通告</span>
					<span class="editBtn" @click="goNavPage('/myPages/pages/NoticeLabelSet')">编辑</span>
				</view>
				<view style="padding-top:20rpx;">
					<view class="label" v-for="(item,index) in MyNoticeLabels" :key="index">
						{{ item.text }}
					</view>
					<view style="clear:both">
						<view v-for="(item,index) in MyPingmianLabels" :key="index">
							<view :class="itm.vip?'viplabel':'label'" v-for="(itm,idx) in item.Labels" :key="idx">
								{{ itm.text }}
							</view>
						</view>
					</view>
				</view>
				<view style="clear:both"></view>
			</view>
			<view class="artisterPhoto artisterBox">
				<view class="artisterInfoTitle">自我简介</view>
				<fui-textarea :size="24" v-model="formData.content" placeholder="请输入内容"></fui-textarea>
			</view>
		</fui-form>

		<view class="saveBtns">
			<view style="width: 90vw; display: inline-block;">
				<fui-button background="#FFDD00" width="100%" height="70rpx" color="#000" class="saveBtn"
					@click="saveMyInfo">下一步</fui-button>
			</view>
		</view>
		<!-- 	<view class="saveBtns">
			<fui-button background="#FFDD00" width="90%" height="70rpx" color="#000" class="saveBtn" @click="saveMyInfo">下一步</fui-button>
		</view> -->
		<view style="height:150rpx"></view>
		<fui-picker linkage :options="sexs" :show="sexShow" @change="changeSex" @cancel="cancel('sex')"></fui-picker>
		<fui-date-picker :show="birthdayShow" type="3" minDate="1940-01-01" value="1990-01-01" @change="changeBirthday"
			@cancel="cancel('birthday')"></fui-date-picker>
		<fui-picker linkage :layer="3" :options="cityOptions" :show="cityShow" @change="changeCity"
			@cancel="cancel('city')"></fui-picker>
		<fui-picker :options="shengaos" :value="UserBaseinfo.shengao" :show="showShengaos" @change="changeShengao"
			@cancel="cancelShengaos"></fui-picker>
		<fui-picker :options="tizhongs" :value="UserBaseinfo.tizhong" :show="showTizhongs" @change="changeTizhong"
			@cancel="cancelTizhongs"></fui-picker>
		<fui-picker :layer="3" :options="sanweis" :value="UserBaseinfo.sanwei" :show="showSanweis"
			@change="changeSanwei" @cancel="cancelSanweis"></fui-picker>
		<fui-picker :options="jiaomas" :value="UserBaseinfo.jiaoma" :show="showJiaomas" @change="changeJiaoma"
			@cancel="cancelJiaomas"></fui-picker>
		<fui-picker :options="zhaobeis" :value="UserBaseinfo.zhaobei" :show="showZhaobeis" @change="changeZhaobei"
			@cancel="cancelZhaobei"></fui-picker>
	</view>
</template>

<script>
	import cityData from "@/script/city.js";
	//校验规则
	// const rules = [];
	export default {
		data() {
			return {
				width: 600,
				height: 400,
				// 裁剪框是否显示
				isShowTailor: false,
				// 接收裁剪的图片
				TailorSrc: '',
				// 判断裁切类型，0 背景裁切、1 头像裁切
				CuttingType: 0,
				rules: [],
				mokaStyle: 0,
				mokaTemplateID: 0,
				userInfo: {},
				imageUpfileUrl: 'https://api.meimo.comdns.cn/common/Upload/upload?file=userbase&type=image',
				bgPics: [],
				bgpic: '',
				headList: [],
				headpic: '',
				//上传视频接口地址
				videoUpLoadUrl: 'https://api.meimo.comdns.cn/common/Upload/upload?file=uservideo&type=video',
				//上传状态，用于保存或其他操作时做判断
				upStatus: '',
				//上传的视频地址列表
				VideoUrls: [],
				//表单data数据
				formData: {
					saveType: 1,
					bgPic: '',
					headPic: '',
					nickName: '',
					sex: {
						value: -1,
						text: '请设置性别'
					},
					birthday: '请设置您的生日',
					city: '请设置您所在的地区',
					cityJson: {},
					cityCode: [],
					content: '',
					video: ''
				},
				sexShow: false,
				sexs: [{
						value: -1,
						text: '请设置性别'
					},
					{
						value: 0,
						text: '女'
					},
					{
						value: 1,
						text: '男'
					}
				],
				birthdayShow: false,
				cityShow: false,
				cityOptions: [],
				userRoles: [{
					LabelID: 0,
					LabelName: '请设置您的身份角色'
				}],
				SetRoleLabels: [],
				xingxiangLabels: [],
				UserBaseinfo: {
					shengao: '',
					tizhong: '',
					sanwei: ['', '', '', ''],
					jiaoma: ''
				},
				UserPhotos: [],
				MyNoticeLabels: [],
				MyPingmianLabels: [],
				shengaos: [],
				tizhongs: [],
				sanweis: [],
				jiaomas: [],
				zhaobeis: [],
				showShengaos: false,
				showTizhongs: false,
				showSanweis: false,
				showJiaomas: false,
				showZhaobeis: false,

			};
		},
		onLoad(option) {
			this.mokaStyle = option.style
			this.mokaTemplateID = option.mokaTemplateID;
			this.tempMoka = uni.getStorageSync("tempMoka");


		},
		onShow() {
			for (let i = 140; i < 201; i++) {
				this.shengaos.push(i);
			}
			for (let i = 40; i < 101; i++) {
				this.tizhongs.push(i);
			}

			let sanwei = [];
			for (let i = 40; i < 121; i++) {
				sanwei.push(i);
			}

			let xiongwei = ['A', 'B', 'C', 'D', 'E', 'F'];
			this.zhaobeis.push(xiongwei)
			// this.sanweis.push(xiongwei)
			this.sanweis.push(sanwei)
			this.sanweis.push(sanwei)
			this.sanweis.push(sanwei)

			// console.log(this.sanweis)

			for (let i = 20; i < 49; i++) {
				this.jiaomas.push(i);
			}

			// console.log(this.mokaStyle, this.mokaTemplateID, this.tempMoka);
			this.getUserInfo();

		},
		onUnload() {
			uni.removeStorageSync("bgPics")
			uni.removeStorageSync("headList")
		},
		methods: {

			uploadImage(tmpFile) {
				return new Promise((reslove, reject) => {
					uni.uploadFile({
						url: this.imageUpfileUrl, //仅为示例，非真实的接口地址
						filePath: tmpFile,
						name: "file",
						formData: {},
						success: (uploadFileRes) => {
							reslove(this.$baseUrl + JSON.parse(uploadFileRes.data).fileName)

						}
					})
				})
			},

			// 旋转裁切
			onRotateTailor() {
				this.$refs.tailor && this.$refs.tailor.rotate()
			},
			// 确定裁切
			async onSubmitTailor(fileImage) {
				// console.log('TailorSrc', this.TailorSrc)
				// if (this.$refs.tailor) {
				// 	this.$refs.tailor.cutting(async fileImage => {
				// console.log('file', fileImage)
				if (this.CuttingType === 0) {
					this.bgPics = []
					let localStorageBgPics = await this.uploadImage(fileImage.path)
					uni.setStorageSync("bgPics", localStorageBgPics)
					this.bgPics.push(localStorageBgPics)
				} else {
					this.headList = []
					let localStorageheadList = await this.uploadImage(fileImage.path)
					uni.setStorageSync("headList", localStorageheadList)
					this.headList.push(localStorageheadList)
					// console.log("this.headList", this.headList)
				}
				this.isShowTailor = false
				// 	})
				// }
			},
			getUserInfo() {
				// console.log("执行getUserInfo")
				this.bgPics = []
				this.headList = []
				this.$httpost('/UserAction/getUserInfo').then(res => {
					// console.log(res)
					if (res.code == 200) {
						this.userInfo = res.data.UserInfo
						if (res.data.UserRole.length > 0) {
							this.userRoles = res.data.UserRole
						}

						if (uni.getStorageSync("bgPics")) {
							this.bgPics.push(uni.getStorageSync("bgPics"))
						} else {
							if (this.userInfo.BackgroundPic) {
								this.bgPics[0] = this.userInfo.BackgroundPic
								// console.log(this.bgPics[0])
							}
						}

						if (uni.getStorageSync("headList")) {
							this.headList.push(uni.getStorageSync("headList"))
						} else {
							if (this.userInfo.WxHeadPic) {
								this.headList[0] = this.userInfo.WxHeadPic
							}
						}
						// console.log(this.userInfo.BackgroundPic, this.bgPics[0],this.headList[0])

						this.formData.nickName = this.userInfo.NickName

						if (!this.userInfo.UserSex) {
							this.formData.sex = this.formData.sex
						} else {
							this.formData.sex = JSON.parse(this.userInfo.UserSex)
						}
						if (!this.userInfo.UserBirth) {
							this.formData.birthday = '请设置您的生日'
						} else {
							this.formData.birthday = this.userInfo.UserBirth
						}
						if (!this.userInfo.UserCity) {
							this.formData.city = '请设置您所在的城市'
						} else {
							this.formData.cityJson = JSON.parse(this.userInfo.UserCityJson)
							this.formData.city = this.userInfo.UserCity
						}

						this.formData.content = this.userInfo.UserMemo

						if (JSON.parse(res.data.UserInfo.SetRoleLabels) != null) {
							this.SetRoleLabels = JSON.parse(res.data.UserInfo.SetRoleLabels)
						}
						if (JSON.parse(res.data.UserInfo.xingxiangLabels) != null) {
							this.xingxiangLabels = JSON.parse(res.data.UserInfo.xingxiangLabels)
						}
						if (JSON.parse(res.data.UserInfo.UserBaseinfo) != null) {
							this.UserBaseinfo = JSON.parse(res.data.UserInfo.UserBaseinfo);
						}
						if (JSON.parse(res.data.UserInfo.UserPhotos) != null) {
							this.UserPhotos = JSON.parse(res.data.UserInfo.UserPhotos);
						}
						if (JSON.parse(res.data.UserInfo.MyNoticeLabels) != null) {
							this.MyNoticeLabels = JSON.parse(res.data.UserInfo.MyNoticeLabels);
						}
						if (JSON.parse(res.data.UserInfo.MyPingmianLabels) != null) {
							this.MyPingmianLabels = JSON.parse(res.data.UserInfo.MyPingmianLabels);
						}

					}

				})
			},
			goNavPage(url) {
				uni.navigateTo({
					url: url
				})
			},
			showZhaobei() {
				this.showZhaobeis = true;
			},
			changeZhaobei(e) {
				this.UserBaseinfo.zhaobei = e.result;
				this.showZhaobeis = false;
			},
			cancelZhaobei(e) {
				this.showZhaobeis = false;
			},
			showShengao() {
				this.showShengaos = true
			},
			changeShengao(e) {
				// console.log(e.result,'222222222222')
				this.UserBaseinfo.shengao = e.result
				this.showShengaos = false
			},
			cancelShengaos() {
				this.showShengaos = false
			},
			showTizhong() {
				this.showTizhongs = true
			},
			changeTizhong(e) {
				// console.log(e)
				this.UserBaseinfo.tizhong = e.result
				this.showTizhongs = false
			},
			cancelTizhongs() {
				this.showTizhongs = false
			},
			showSanwei() {
				this.showSanweis = true
			},
			changeSanwei(e) {
				// console.log(e)/
				this.UserBaseinfo.sanwei = e.value
				this.showSanweis = false
			},
			cancelSanweis() {
				this.showSanweis = false
			},
			showJiaoma() {
				this.showJiaomas = true
			},
			changeJiaoma(e) {
				// console.log(e)
				this.UserBaseinfo.jiaoma = e.result
				this.showJiaomas = false
			},
			cancelJiaomas() {
				this.showJiaomas = false
			},
			bgPicUpSuccess(e) {
				// console.log(e)
				let res = JSON.parse(e.res.data.replace(/\ufeff/g, "") || "{}")
				this.upStatus = e.status
				if (res.fileName) {
					//处理结果返回给组件 
					//res.data.url为上传成功后返回的图片地址
					//e.index为图片索引值
					this.$refs.bgPicUpload.result(this.$baseUrl + res.fileName, e.index)
				}
			},
			//上传失败时触发
			bgPicUpError(e) {
				// console.log(e)
				this.upStatus = e.status
			},
			//选择视频或上传完成时触发
			bgPicUpComplete(e) {

				this.upStatus = e.status;
				// uni.setStorageSync("bgPics", e.urls)
				this.TailorSrc = e.urls[0]
				// this.isShowTailor = true
				// console.log('this.TailorSrc', this.TailorSrc)
				this.width = 600;
				this.height = 400;
				this.CuttingType = 0
				if (!!this.TailorSrc) this.isShowTailor = true
				// if (this.upStatus === 'success' && e.action === 'upload') {
				// 	console.log('this.bgPics', this.bgPics)
				// }
			},
			HeadPicUpSuccess(e) {
				// console.log(e)
				let res = JSON.parse(e.res.data.replace(/\ufeff/g, "") || "{}")
				this.upStatus = e.status
				if (res.fileName) {
					//处理结果返回给组件 
					//res.data.url为上传成功后返回的图片地址
					//e.index为图片索引值
					this.$refs.HeadPicmUpload.result(this.$baseUrl + res.fileName, e.index)
				}
			},
			//上传失败时触发
			HeadPicUpError(e) {
				// console.log(e)
				this.upStatus = e.status
			},
			//选择视频或上传完成时触发
			HeadPicUpComplete(e) {
				this.upStatus = e.status
				// uni.setStorageSync("headList", e.urls)
				this.TailorSrc = e.urls[0]
				this.CuttingType = 1
				// this.headList = uni.getStorageSync("headList")
				// this.receiveheadList = e.urls
				this.width = 400;
				this.height = 400;
				if (!!this.TailorSrc) this.isShowTailor = true
				// if (this.upStatus === 'success' && e.action === 'upload') {
				// 	console.log(this.headList)
				// }
			},
			//上传成功时触发
			VideoUpSuccess(e) {
				let res = JSON.parse(e.res.data.replace(/\ufeff/g, "") || "{}")
				this.upStatus = e.status
				if (res.fileName) {
					//处理结果返回给组件 
					//res.data.url为上传成功后返回的视频地址
					//e.index为视频索引值
					this.$refs.VideoUpload.result(this.$baseUrl + res.fileName, e.index)
				}
			},
			//上传失败时触发
			VideoUpError(e) {
				this.upStatus = e.status
			},
			//选择视频或上传完成时触发
			VideoUpComplete(e) {
				this.upStatus = e.status
				this.VideoUrls = e.urls
				if (this.upStatus === 'success' && e.action === 'upload') {
					// console.log(this.VideoUrls)
				}
			},
			showSex() {
				this.sexShow = true
			},
			showBirthday() {
				this.birthdayShow = true
			},
			showCity() {
				this.cityShow = true
			},
			changeSex(e) {
				// console.log(e)
				this.formData.sex = e
				this.sexShow = false

				if (this.formData.sex.value == 0) {
					const UserSex = JSON.parse(this.userInfo.UserSex)
					UserSex.value = 0
					this.userInfo.UserSex = JSON.stringify(UserSex)
				} else {
					const UserSex = JSON.parse(this.userInfo.UserSex)
					UserSex.value = 1
					this.userInfo.UserSex = JSON.stringify(UserSex)
				}
			},
			changeBirthday(e) {
				// console.log(e)
				this.formData.birthday = e.result
				this.birthdayShow = false
			},
			changeCity(e) {
				// console.log(e)
				this.formData.cityJson = e
				this.formData.city = e.result
				this.formData.cityCode = e.value
				this.cityShow = false
			},
			cancel(type) {
				if (type == 'sex') {
					this.sexShow = false
				}
				if (type == 'birthday') {
					this.birthdayShow = false
				}
				if (type == 'city') {
					this.cityShow = false
				}
			},
			goPage(url) {
				uni.navigateTo({
					url: url
				})
			},
			setUserRole() {
				// console.log('setUserRole')
				// this.goPage('/myPages/pages/setUerRole');				
				this.$common.goNavPage('/myPages/pages/setUerRole');
			},
			saveBaseInfo() {
				const _that = this;
				this.$httpost('/UserAction/saveMyBaseInfo', {
					shengao: this.UserBaseinfo.shengao,
					tizhong: this.UserBaseinfo.tizhong,
					sanwei: this.UserBaseinfo.sanwei,
					jiaoma: this.UserBaseinfo.jiaoma
				}).then(res => {
					_that.saveMyInfo();
				});
			},
			saveMyInfo() {
				// console.log('form', this.formData);
				// console.log('bgPics', this.bgPics.length);
				// console.log('headList', this.headList.length);
				try {
					if (this.bgPics.length == 0) {
						this.$common.showToast("请为自己设置一个背景！");
						return false;
					}
					if (this.headList.length == 0) {
						this.$common.showToast("请为自己设置一个头像！");
						return false;
					}
					if (this.formData.nickName == '') {
						this.$common.showToast("请为自己起个昵称！");
						return false;
					}


					if (this.userRoles.length === 0) {
						this.$common.showToast("请设置您的身份角色！");
						return false;
					} else {
						if (this.userRoles[0].LabelID === 0) {
							this.$common.showToast("请设置您的身份角色！");
							return false;
						}
					}

					if (this.formData.sex.value == -1) {
						this.$common.showToast("请设置您的性别！");
						return false;
					}



					if (this.formData.birthday == '请设置您的生日') {
						this.$common.showToast("请设置您的生日！");
						return false;
					}

					if (this.formData.city == '请设置您所在的地区') {
						this.$common.showToast("请设置您所在的地区！");
						return false;
					}
					if (this.UserPhotos.length < 3) {
						this.$common.showToast("请您上传至少三张形象照片!");
						return false;
					}
					if (this.UserBaseinfo.shengao == "") {
						this.$common.showToast("请填写你的身高!");
						return false;
					}

					if (this.UserBaseinfo.tizhong == "") {
						this.$common.showToast("请填写你的体重!");
						return false;
					}

					if (this.UserBaseinfo.sanwei[0] == "" && this.UserBaseinfo.sanwei[1] == "" && this.UserBaseinfo.sanwei[
							2] == "" && this.UserBaseinfo.sanwei[3] == "") {
						this.$common.showToast("请填写你的三围!");
						return false;
					}

					if (this.formData.sex.value == 0 || JSON.parse(this.userInfo.UserSex).value == 0) {
						console.log(this.UserBaseinfo.zhaobei, '走这里了吗？');
						if (!this.UserBaseinfo.zhaobei || this.UserBaseinfo.zhaobei == "") {
							this.$common.showToast("请选择您的罩杯!");
							return false;
						}
					}
					if (this.UserBaseinfo.jiaoma == "") {
						this.$common.showToast("请填写你的鞋码!");
						return false;
					}

					if (this.SetRoleLabels.length == 0) {
						this.$common.showToast("请选择您的身份标签!");
						return false;
					}

					if (this.xingxiangLabels.length == 0) {
						this.$common.showToast("请填写您的形象风格!");
						return false;
					}

					if (this.MyNoticeLabels.length == 0) {
						this.$common.showToast("请填写您的接单通告!");
						return false;
					}

					this.formData.bgPic = this.bgPics[0]
					this.formData.headPic = this.headList[0]
					this.formData.video = this.VideoUrls[0]
					this.formData.UserBaseinfo = this.UserBaseinfo
					// console.log('form11111', this.formData);
					const _that = this;

					this.$httpost('/UserAction/saveUserInfo', this.formData).then(res => {
						if (res.code == 200) {
							// console.log(res)
							uni.removeStorageSync("bgPics")
							uni.removeStorageSync("headList")
							// this.$common.goNavPage("/myPages/pages/mypage");
							// console.log("/myPages/pages/mypage");
							// uni.navigateBack()
							if (this.mokaStyle) {
								_that.goMackMoka();
							} else {
								uni.navigateBack()
							}
						}
					});
				} catch (err) {
					console.log(err)
				}




			},
			goMackMoka() {
				if (this.mokaStyle == 1) {
					uni.navigateTo({
						url: '/moka/pages/mokaMakeingHeng?otherID=0&mokaTemplateID=' + this.mokaTemplateID
					})
				} else if (this.mokaStyle == 2) {
					uni.navigateTo({
						url: '/moka/pages/mokaMakeingShu?otherID=0&mokaTemplateID=' + this.mokaTemplateID
					})
				}
			}
		}
	}
</script>

<style lang="scss">
	.artisterBox {
		height: auto;
		padding: 20rpx;
		background-color: #FFF;
		margin-top: 15rpx;
	}

	.artisterInfoTitle {
		font-weight: bold;
		font-size: 30rpx;
	}

	.artPics {
		clear: both;
		display: flex;
		// justify-content: space-between;
		margin-top: 40rpx;
		position: relative;
	}

	.artVipPics {
		padding: 30rpx;
		text-align: center;
	}

	.artPicCount {
		position: absolute;
		z-index: 200;
		bottom: 10rpx;
		right: 10rpx;
		width: 50rpx;
		height: 30rpx;
		padding: 5rpx;
		background-color: rgba(0, 0, 0, 0.5);
		color: #FFF;
		text-align: center;
		border-radius: 10rpx;
		font-size: 20rpx;
	}

	.artPic {
		width: calc((100% - 60rpx) / 3);
		height: 300rpx;
		background-color: #999;
		margin: 10rpx;
		border-radius: 5rpx;
		overflow: hidden;
	}

	.artPic image {
		width: 100%;
		height: 300rpx;
		border-radius: 5rpx;
	}

	.label {
		float: left;
		width: auto;
		height: 50rpx;
		line-height: 50rpx;
		text-align: center;
		border: 1rpx solid #f0f0f0;
		border-radius: 10rpx;
		font-size: 24rpx;
		margin: 10rpx;
		padding-left: 10rpx;
		padding-right: 10rpx;
	}

	.viplabel {
		float: left;
		width: auto;
		height: 50rpx;
		line-height: 50rpx;
		text-align: center;
		background-color: #FF6600;
		color: #FFF;
		border: 1rpx solid #f0f0f0;
		border-radius: 10rpx;
		font-size: 24rpx;
		margin: 10rpx;
		padding-left: 10rpx;
		padding-right: 10rpx;
	}

	.saveBtns {
		width: 100vw;
		position: fixed;
		z-index: 100;
		bottom: 20rpx;
		left: 0;
		right: 0;
		text-align: center;
	}

	.saveBtn {
		margin: auto;
	}


	.fui-cropper__tabbar {
		/* #ifndef APP-NVUE */
		display: flex;
		z-index: 20;
		position: relative;
		/* #endif */
		flex-direction: row;
		align-items: center;
		justify-content: space-between;
		position: fixed;
		height: 120rpx;
		left: 0;
		right: 0;
		bottom: 0;
		/* #ifdef APP-NVUE */
		border-top: 0.5px solid #666;
		/* #endif */
	}

	/* #ifndef APP-NVUE */
	.fui-cropper__tabbar::before {
		content: ' ';
		position: absolute;
		top: 0;
		left: 0;
		right: 0;
		height: 1px;
		border-top: 1px solid #666;
		transform: scaleY(0.5);
		transform-origin: 0 0;
		z-index: 21;
	}

	/* #endif */

	.fui-text {
		/* #ifndef APP-NVUE */
		display: flex;
		/* #endif */
		font-size: 32rpx;
		font-weight: normal;
		color: #fff;
		flex: 1;
		text-align: center;
		justify-content: center;
		align-items: center;
		height: 80rpx;
		line-height: 80rpx;
		/* #ifdef H5 */
		cursor: pointer;
		/* #endif */
	}
</style>